package cn.edu.Day08;



import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;

public class NewListTest extends News{
    public static void main(String[] args) {
//        List<News> list=new ArrayList<>();
//        for (int i = 0; i <10 ; i++) {
//            News news=new News(0L+i,"author"+i,"titile"+i,"context"+i,"2020-07-05 18:00:00","15646"+i);
//            list.add(news);
//        }
//        for(News n:list)
//        {
//            System.out.println(n);
//        }
        News news=new News();
        News news1=new News();
        List list=new ArrayList();
        List list1=new ArrayList();
        news.setID(123);
        news.setAuthor("sdfsdf");
        news.setTitle("sdfs");
        news.setContext("sfsdf");
        news.setCreateTime("2020-07-05 18:00:00");
        news.setUpdateTime(new Date());
        list.add(news);
        list.add(news.getID());
        list.add(news.getAuthor());
        list.add(news.getTitle());
        list.add(news.getContext());
        list.add(news.getCreateTime());
        list.add(news.getUpdateTime());
        news1.setID(123);
        news1.setAuthor("sdfsdf");
        news1.setTitle("sdfs");
        news1.setContext("sfsdf");
        news1.setCreateTime("sfsdf");
        news1.setUpdateTime(new Date());
        list1.add(news1.getID());
        list1.add(news1.getAuthor());
        list1.add(news1.getTitle());
        list1.add(news1.getContext());
        list1.add(news1.getCreateTime());
        list1.add(news1.getUpdateTime());
        list1.add(news1);
        System.out.println(list);
        System.out.println(list1);
    }
}
